import type { ILoginState } from './login/types';
import type { ISystemState } from './system/types';
import type { IDashboardState } from './analysis/types';

type departmentListType = {
  id: number;
  name: string;
  leader: string | null;
  parentId: number | null;
  createAt: string;
  updateAt: string;
};
export type menuListType = {
  id: number;
  name: string;
  type: number;
  url: string | null;
  icon: string | null;
  sort: number;
  createAt?: string;
  updateAt?: string;
  permission?: string;
  children?: menuListType[];
};
type roleListType = {
  id: number;
  name: string;
  intro: string;
  createAt: string;
  updateAt: string;
  menuList: menuListType[];
};

export interface IRootState {
  name: string;
  age: number;
  entireDepartment: departmentListType[];
  entireRole: roleListType[];
  entireMenu: menuListType[];
}
export interface IRootWithModule {
  login: ILoginState;
  system: ISystemState;
  dashboard: IDashboardState;
}

export type IStoreType = IRootState & IRootWithModule;
